home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1999 #2 / Amiga Plus CD - 1999 - No. 2.iso / System-Boost / Workbench / ToolManager / Source / Library / misc.c < prev    next >
C/C++ Source or Header  |  1998-06-17  |  2KB  |  59 lines

  1. /*
  2.  * misc.c  V3.1
  3.  *
  4.  * ToolManager library miscellaneous routines
  5.  *
  6.  * Copyright (C) 1990-98 Stefan Becker
  7.  *
  8.  * This source code is for educational purposes only. You may study it
  9.  * and copy ideas or algorithms from it for your own projects. It is
  10.  * not allowed to use any of the source codes (in full or in parts)
  11.  * in other programs. Especially it is not allowed to create variants
  12.  * of ToolManager or ToolManager-like programs from this source code.
  13.  *
  14.  */
  15.  
  16. #include "toolmanager.h"
  17.  
  18. #ifdef _DCC
  19. /* VarArgs stub for OpenWindowTagList */
  20. struct Window *OpenWindowTags(struct NewWindow *nw, Tag tag1, ...)
  21. {
  22.  return(OpenWindowTagList(nw, (struct TagItem *) &tag1));
  23. }
  24.  
  25. /* VarArgs stub for NewObjectA */
  26. APTR NewObject(struct IClass *class, UBYTE *classID, Tag tag1, ... )
  27. {
  28.  return(NewObjectA(class, classID, (struct TagItem *) &tag1));
  29. }
  30.  
  31. /* VarArgs stub for SetAttrsA */
  32. ULONG SetAttrs(APTR obj, Tag tag1, ...)
  33. {
  34.  return(SetAttrsA(obj, (struct TagItem *) &tag1));
  35. }
  36.  
  37. /* VarArgs stub for SetGadgetAttrsA */
  38. ULONG SetGadgetAttrs(APTR obj, struct Window *w, struct Requester *r, Tag tag1,
  39.                      ...)
  40. {
  41.  return(SetGadgetAttrsA(obj, w, r, (struct TagItem *) &tag1));
  42. }
  43. #endif
  44.  
  45. /* Reply all messages and then delete port */
  46. void SafeDeleteMsgPort(struct MsgPort *mp)
  47. {
  48.  struct Message *msg;
  49.  
  50.  /* Scan message port list and reply messages */
  51.  while (msg = GetMsg(mp)) ReplyMsg(msg);
  52.  
  53.  /* Delete message port */
  54.  DeleteMsgPort(mp);
  55. }
  56.  
  57. /* Include global miscellaneous code */
  58. #include "/global_misc.c"
  59.